Skip to content

[pull] main from MetaMask:main#373

Merged
pull[bot] merged 6 commits into
Reality2byte:mainfrom
MetaMask:main
Dec 2, 2025
Merged

[pull] main from MetaMask:main#373
pull[bot] merged 6 commits into
Reality2byte:mainfrom
MetaMask:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Dec 2, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

FrederikBolding and others added 6 commits December 2, 2025 12:55
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Add Snaps debugging information to the hidden menu on the about page.

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Manual testing steps**

1. Long press the fox icon on the about screen

## **Screenshots/Recordings**

### **After**
<img width="300" height="2622" alt="Simulator Screenshot - iPhone 16 Pro
- 2025-12-02 at 12 23 24"
src="https://github.com/user-attachments/assets/dd84e477-82a5-45f0-85f5-60bfcd35f86b"
/>

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Connects About screen to Redux to show preinstalled Snaps (name,
version, status) in the hidden debug section, with new selector support
and updated tests.
> 
> - **Settings/About (`app/components/Views/Settings/AppInformation`)**:
> - Connects component to Redux and injects `preinstalledSnaps` via
`getPreinstalledSnapsMetadata`.
> - Displays each preinstalled Snap as `name: version (status)` in the
hidden environment info (long-press fox).
> - **Selectors (`app/selectors/snaps/snapController.ts`)**:
> - Extends `selectSnapsMetadata` to include `version`, `status`, and
`preinstalled`.
>   - Adds `getPreinstalledSnapsMetadata` to filter preinstalled Snaps.
> - **Tests (`index.test.tsx`)**:
> - Provide mock state with a preinstalled Snap; assert its display in
the debug section.
>   - Update utilities/types imports to support mocked Redux state.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3767b00. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

- Fix for mock server url string 

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry:

## **Related issues**

Fixes:

## **Manual testing steps**

```gherkin
Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Normalizes `fetch` input (string/URL/Request) to a URL string before
routing via the mock server proxy, with fallback to original `fetch`.
> 
> - **E2E Shim (`shim.js`)**:
> - Update `global.fetch` wrapper to normalize input (`string`, `URL`,
or `Request`) into a URL string before proxying to `MOCKTTP_URL`.
> - Continue proxying via `/proxy?url=...` with fallback to original
`fetch` on error.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
2a7dce5. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description**

PR to remove the usePopularNetworks hook in favor of constant list for
trending.

## **Changelog**

CHANGELOG entry: Removes usePopularNetworks hook and replace it with
constant.

## **Related issues**

Fixes:
https://consensyssoftware.atlassian.net/jira/software/c/projects/ASSETS/boards/1567?assignee=61a5edc8b0b630006a140ec1&selectedIssue=ASSETS-1916

## **Manual testing steps**

```gherkin
Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Replaces the dynamic popular networks hook with a static
TRENDING_NETWORKS_LIST used across trending UI and hooks, removes the
hook/tests, and adds SEI to network constants.
> 
> - **Trending networks source**:
> - Introduce static `TRENDING_NETWORKS_LIST` in
`app/components/UI/Trending/utils/trendingNetworksList.ts` with
predefined `ProcessedNetwork` entries (incl. Solana/Tron guards).
> - Add `SEI` to `NetworkToCaipChainId`
(`app/components/UI/NetworkMultiSelector/NetworkMultiSelector.constants.ts`).
> - **Hook and component updates**:
>   - Replace `usePopularNetworks` with `TRENDING_NETWORKS_LIST` in:
>     - `useTrendingRequest.ts`
>     - `useSearchRequest.ts`
>     - `TrendingTokenNetworkBottomSheet.tsx`
> - **Removals**:
>   - Delete `usePopularNetworks` hook and its tests.
> - **Tests**:
>   - Update tests to mock `TRENDING_NETWORKS_LIST` and expectations in:
>     - `TrendingTokenNetworkBottomSheet.test.tsx`
>     - `TrendingTokenRowItem.test.tsx`
>     - `useTrendingRequest.test.ts`
>     - `useSearchRequest.test.ts`
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
02a7160. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description**

When generating delegation data for the `TransactionPayController`,
overwrite any existing EIP-7702 delegation if not supported.

Also bump the controller version to include missing authorization lists
on Predict deposit source transactions, when payment token is on
Polygon.

## **Changelog**

CHANGELOG entry: Fixed bugs causing failed Perps and Predict deposits
due to unsupported or missing account upgrades

## **Related issues**

Fixes: #23494 #23514 

## **Manual testing steps**

## **Screenshots/Recordings**

### **Before**

### **After**

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Refactors delegation to correctly build/overwrite EIP-7702
authorizations with validation, integrates Transaction Pay and
Delegation 7702 hooks into publish flow, and bumps transaction-related
controllers.
> 
> - **Engine/TransactionController init**:
> - Integrates `TransactionPayPublishHook` and
`Delegation7702PublishHook` with fallback logic before smart
transactions.
> - Adds `isEIP7702GasFeeTokensEnabled`, `publicKeyEIP7702`, and
`getNextNonce` helper.
>   - Exposes `getNetworkState` via `networkController.state`.
> - **Delegation utils (`app/util/transactions/delegation.ts`)**:
> - Refactors `buildAuthorizationList` to use `isAtomicBatchSupported`
result per-chain, throwing on unsupported chains and missing
`upgradeContractAddress`.
> - Skips authorization if already upgraded; overwrites authorization
when upgraded to a different contract.
> - Signs EIP-7702 authorization using nonce lock and builds
`AuthorizationList`.
> - **Tests**:
> - Expands `delegation.test.ts` with cases for already upgraded,
different upgrade target, signing calls, and error paths; updates
snapshot name.
> - **Dependencies**:
> - Bumps `@metamask/transaction-controller` to `62.4.0` and
`@metamask/transaction-pay-controller` to `^10.3.0` (and associated
`@metamask/network-controller` peer to `^27`).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
923e879. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
The `@metamask/profile-metrics-controller` package is being added to the
Mobile client. The package ships two new components and their
messengers:
- `ProfileMetricsController`
- `ProfileMetricsService`

Preview build coming from MetaMask/core#7196

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: null

## **Related issues**

Related to https://consensyssoftware.atlassian.net/browse/WPC-179

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Integrates `ProfileMetricsController` and `ProfileMetricsService`
across Engine init, messengers, types, state, and tests, and adds
`@metamask/profile-metrics-controller` dependency.
> 
> - **Engine**:
> - Initialize and register `ProfileMetricsController` and
`ProfileMetricsService` in `Engine` init, add to `context`, and expose
`ProfileMetricsController` in `state`.
> - **Controllers/Services**:
> - Add `profile-metrics-controller-init` (uses
`RemoteFeatureFlagController` flag `extensionUxPna25` +
`MetaMetrics.isEnabled` and `metaMetricsId`).
> - Add `profile-metrics-service-init` (binds `fetch`, uses
`SDK.Env.PRD`).
> - **Messengers**:
> - New restricted messengers `profile-metrics-controller-messenger` and
`profile-metrics-service-messenger`; register both in
`CONTROLLER_MESSENGERS`.
> - **Types/Constants**:
> - Extend global actions/events, controller names, `EngineState`,
`ControllersToInitialize` for profile metrics; add
`ProfileMetricsService` to `STATELESS_NON_CONTROLLER_NAMES`; add
`ProfileMetricsController:stateChange` to background events.
> - **State/Fixtures**:
> - Include `ProfileMetricsController` default state in snapshots and
initial background state.
> - **Tests**:
>   - Add init and messenger tests for controller/service.
> - **Dependencies**:
>   - Add `@metamask/profile-metrics-controller` to `package.json`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d0e0e4a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…22683)

## **Description**

### Problem
We are asking the user to opt into metrics/marketing twice, first time
is when the user installs the app, and the second time when the user
opens the web browser within the app. We have query params being passed
into Portfolio called `marketingEnabled` and `metricsEnabled` which
SHOULD opt in the user's tracking preferences thus dismissing the second
opt-in modal. The issue is that we are inconsistently passing these
params into various entry points

### Solution
Pass in the opted in metrics from mobile into the portfolio web app via
query params. Created a new `useBuildPortfolioUrl` hook that
automatically includes `marketingEnabled` and `metricsEnabled` query
parameters when building Portfolio URLs. This centralizes the logic for
including user consent preferences and ensures consistency across the
app.

### Changes

New Hook
- Created `app/components/hooks/useBuildPortfolioUrl.ts`
  - Subscribes to `isDataCollectionForMarketingEnabled` from Redux state
  - Subscribes to `metricsEnabled` from the `useMetrics` hook
- Returns a memoized function that builds Portfolio URLs with consent
parameters automatically
included
  - Supports additional parameters via the second argument
- Updated all Portfolio URL entry points to use new hook

Before:
```typescript
const isDataCollectionForMarketingEnabled = useSelector(
  (state) => state.security.dataCollectionForMarketing,
);
const { isEnabled } = useMetrics();

const portfolioUrl = buildPortfolioUrl(
  AppConstants.PORTFOLIO.URL,
  {
    marketingEnabled: isDataCollectionForMarketingEnabled ?? false,
    metricsEnabled: isEnabled(),
    srcChain: chainId,
  },
);
```

  After:
```typescript
const buildPortfolioUrlWithMetrics = useBuildPortfolioUrl();

const portfolioUrl = buildPortfolioUrlWithMetrics(
  AppConstants.PORTFOLIO.URL,
  { srcChain: chainId },
);
```

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: Improved Portfolio integration by passing tracking
consent from Mobile app

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-45

## **Manual testing steps**

```gherkin
  Feature: Portfolio tracking consent parameter

    Scenario: user with no tracking preference opens Portfolio
      Given user has not set tracking preference in app settings
      When user taps the Portfolio link from wallet home screen
      Then Portfolio URL should not include `marketingEnabled` and `metricsEnabled` parameter
      And Portfolio website should display the consent modal

    Scenario: user who accepted tracking opens Portfolio
      Given user has accepted tracking in app settings
      When user taps the Portfolio link from wallet home screen
      Then Portfolio URL should include `marketingEnabled` and `metricsEnabled` as true
      And Portfolio website should skip the consent modal

    Scenario: user who declined tracking opens Portfolio
      Given user has declined tracking in app settings
      When user taps the Portfolio link from wallet home screen
      Then Portfolio URL should include `marketingEnabled` and `metricsEnabled` as false
      And Portfolio website should skip the consent modal

    Scenario: user opens Portfolio Bridge with tracking consent
      Given user has accepted tracking in app settings
      When user taps "Bridge" from token asset options
      Then Portfolio Bridge URL should include `marketingEnabled` and `metricsEnabled` is true
      And Portfolio Bridge URL should include srcChain and token parameters
```

## **Screenshots/Recordings**

`~`

### **Before**


https://github.com/user-attachments/assets/4cdcdbec-0ffc-4b36-827e-eb442316eb33

### **After**

#### No Tracking Accepted


https://github.com/user-attachments/assets/58b4ec4b-6fcd-4d52-9f84-f3c4e8de9720

#### Tracking Accepted


https://github.com/user-attachments/assets/60921b12-87eb-40bb-9561-135d7e16742e

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.






<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Adds a reusable hook and util to append metrics/marketing consent
params to Portfolio URLs and updates Portfolio, Bridge, Stake, Browser,
Trending, and AssetOptions flows to use it, with tests.
> 
> - **Hooks/Utils**:
> - Add `useBuildPortfolioUrl` to auto-include `marketingEnabled` and
`metricsEnabled` when building Portfolio URLs.
> - Add `buildPortfolioUrl` in `util/browser` to append standard params;
deprecates scattered `appendURLParams` usage for Portfolio.
> - **UI Integrations**:
> - Update `AccountOverview` to build Portfolio URL with consent and map
`security.dataCollectionForMarketing` to props.
> - Update Bridge navigation (`useGoToPortfolioBridge`) to use hook and
include `srcChain`/`token`.
> - Update `StakeButton` to open Stake via hook-built URL when
ineligible.
>   - Update `AssetOptions` Portfolio navigation to use hook.
>   - Update `Browser` homepage URL generation to use hook.
>   - Update `TrendingView` to use hook for browser button navigation.
>   - Export `SectionHeaderProps` interface.
> - **Tests**:
>   - Add tests for `useBuildPortfolioUrl` and `buildPortfolioUrl`.
> - Update `StakeButton` and `TrendingView` tests to reflect new URL
params.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
57608da. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@pull pull Bot locked and limited conversation to collaborators Dec 2, 2025
@pull pull Bot added the ⤵️ pull label Dec 2, 2025
@pull pull Bot merged commit 4372187 into Reality2byte:main Dec 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants